﻿@model Bricks.Site.Models.ProphaseFileInfoView
@{
    ViewBag.Title = "预览文件";
    Layout = "~/Views/Shared/_UserPage.cshtml";
}


<script type="text/javascript">
    $(function () {
        $('#modifyInfoDataGrid').datagrid({
            url: '/ProphaseFileInfo/GetProphaseFileModifyInfoList?pid=' + $('#hID').val(),
            fitColumns: true,
            nowrap: true,
            autoRowHeight: false,
            striped: true,
            collapsible: true,
            pagination: true,
            pageSize: 20,
            rownumbers: true,
            remoteSort: false,
            idField: 'ID',
            singleSelect: true,
            columns: [[
                        { title: 'ID', field: 'ID', hidden: true },
                        { title: 'PID', field: 'PID', hidden: true },
                        {
                            title: '修改时间', field: 'MidifyTime', width: 100, sortable: true
                        },
                        { title: '修改原因', field: 'MidifyReason', width: 300,}
            ]],
        });
    });
</script>

@*实现对EasyUI的DataGird控件操作的JS代码*@
<script type="text/javascript">
    $(function () {
        var instanceID = $("#hID").val();
        var tag = "ProphaseManagement/ProphaseFileList/Attachment";
        initTable(instanceID, tag);
    });

    function initTable(instanceID, tag) {
        $('#documentGrid').datagrid({
            //url: '/Document/GetDocumentList?instanceID=681764fd-aef8-4dcf-84bd-a2d700ffc9a0&Tag=Test',  //开发期测试
            url: '/Document/GetDocumentList?instanceID=' + instanceID + '&Tag=' + tag,  //运行期使用
            nowrap: true,
            autoRowHeight: true,
            striped: true,
            collapsible: true,
            rownumbers: true,
            remoteSort: false,
            idField: 'ID',
            singleSelect: true,
            //queryParams: queryData,
            columns: [[
                {
                    title: '文件名', field: 'FileName', width: 220,
                    formatter: function (value, row, index) {
                        return '<a href="' + row["FilePath"] + '">' + value + '</a> ';
                    }
                },
                { title: '文件大小', field: 'FileSize', width: 70, sortable: true },
                { field: 'UploadUserID', hidden: true },
                { title: '上传人', field: 'UploadUser', width: 80, sortable: true },
                { title: '上传时间', field: 'UploadTime', width: 100, sortable: true }

            ]],
            toolbar: '#documentToolBar'
        });
    }
</script>
<div class="frombox datagrid-body" style="padding-bottom: 5px;">
    <div class="easyui-layout" style="height:530px;width:100%">
        <div data-options="region:'north'" style="height: 280px;">
            <form id="file-model" method="post">
                <table class="datagrid-btable" border="0" cellspacing="0" cellpadding="0">
                    <tr class="datagrid-row">
                        <td class="th">
                            <div class="datagrid-cell">阶段名称</div>
                        </td>
                        <td class="td" colspan="3">
                            <div class="datagrid-cell">
                                <input name="ProjectStageName" style="width:405px;" value="@Model.ProjectStageName" readonly/>
                            </div>
                        </td>
                        <td class="th">
                            <div class="datagrid-cell">编制状况</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="PreparationStatus" class="easyui-textbox" value="@Model.PreparationStatus" readonly />
                            </div>
                        </td>
                    </tr>
                    <tr class="datagrid-row">
                        <td class="th">
                            <div class="datagrid-cell">计划完成时间</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="PlannedCompletionTime" class="easyui-textbox" value="@Model.PlannedCompletionTime" readonly />
                            </div>
                        </td>
                        <td class="th">
                            <div class="datagrid-cell">批准文号</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="ApprovalNumber" class="easyui-textbox" value="@Model.ApprovalNumber" readonly />
                            </div>
                        </td>
                        <td class="th">
                            <div class="datagrid-cell">批复时间</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="ApprovalTime" class="easyui-textbox" value="@Model.ApprovalTime" readonly />
                            </div>
                        </td>
                    </tr>
                    <tr class="datagrid-row">
                        <td class="th">
                            <div class="datagrid-cell">文件名称</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="FileName" class="easyui-textbox" value="@Model.FileName" readonly />
                            </div>
                        </td>
                        <td class="th">
                            <div class="datagrid-cell">处理人部门</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="DealPersonOrgName" value="@Model.DealPersonOrgName" readonly/>
                            </div>
                        </td>
                        <td class="th">
                            <div class="datagrid-cell">登记时间</div>
                        </td>
                        <td class="td">
                            <div class="datagrid-cell">
                                <input name="DealTime" class="easyui-textbox" value="@Model.DealTime" readonly />
                            </div>
                        </td>
                    </tr>
                    <tr class="datagrid-row">
                        <td class="th">
                            <div class="datagrid-cell">工作内容简述</div>
                        </td>
                        <td class="td" colspan="5">
                            <div class="datagrid-cell">
                                <textarea name="Content" cols="57" rows="5" style="width:640px;" readonly>@Model.Content</textarea>
                            </div>
                        </td>
                    </tr>
                    <tr class="datagrid-row">
                        <td class="th">
                            <div class="datagrid-cell">附件</div>
                        </td>
                        <td class="td" colspan="5">
                            <div class="datagrid-cell">
                                @*<textarea name="Attachment" cols="57" rows="5" style="width:640px;" readonly>@Model.Attachment</textarea>*@
                                @*<a href='javascript:void(0)' class='easyui-linkbutton' onclick='$.Upload($("#hID").val(), "ProphaseManagement/ProphaseFileList/Attachment")' data-options='plain:true,iconCls:"icon-blue_lego"'>附件操作</a>*@
                                <table id="documentGrid" style="height: 95px;"></table>
                            </div>
                        </td>
                    </tr>
                </table>
                <input id="hID" name="ID" type="hidden" value="@Model.ID" />
                <input id="hPID" name="PID" type="hidden" value="@Model.ProjectID" />
                <input id="hDealPerson" name="DealPerson" type="hidden" value="@Model.DealPerson" />
            </form>
        </div>
        <div data-options="region:'center'" style="height:300px;">
            <table id="modifyInfoDataGrid" fit="true"></table>
        </div>
    </div>
</div>

